package buaa.leetcode.Math;


public class Prime {
	public static int[] twoPrimeNum(int odd){
		int first = 1;
		for(;first < Math.sqrt(odd); first += 2){
			if(isPrime(first)){
				if(isPrime(odd - first)){
					return new int[]{first,odd-first};
				}
			}
		}
		return null;
	}
	private static boolean isPrime(int target){
		if(target == 1 || target == 2){
			return true;
		}
		for(int i = 2 ; i * i < target ;i += 2){
			if(target % i == 0){
				return false;
			}
		}
		return true;
	}
	public static void main(String[] args) {
	int[] result =  new int[2];
	result = twoPrimeNum(6);
	System.out.println(result[0]);
	System.out.println(result[1]);
	/*System.out.println(isPrime(5));*/

	}

}
